#pragma once
#include <Windows.h>
#include <windowsx.h>
#include <time.h>
#include <conio.h>
#include <array>
#include "V2D.h"
//#include "Input.h"
//#include "templatevector.h"

// global declarations
#define WINDOW_TITLE L"Engine"
#define MAX_MOUSEBUT 8
#define MAX_KEYS 200

// Sets window to fullscreen
/**
#define FULLSCREEN_MODE
/**/

// Run debug console
/**/
#define MYAPP_DEBUG_TRACE
/**/

//=======================================================================
/**                     WINDOW SCREEN SETUP                             */
#ifndef FULLSCREEN_MODE
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600
#endif
#ifdef FULLSCREEN_MODE
// Get the horizontal and vertical screen sizes in pixel
static int GetDesktopResolutionWidth()
{	
	// bounds for desktop
	RECT desktop;
	// Get a handle to the desktop window
	const HWND hDesktop = GetDesktopWindow();
	// Get the size of screen to the variable desktop
	GetWindowRect(hDesktop, &desktop);
	// return height
	return desktop.right;
}
static int GetDesktopResolutionHeight()
{
	// bounds for desktop
	RECT desktop;
	// Get a handle to the desktop window
	const HWND hDesktop = GetDesktopWindow();
	// Get the size of screen to the variable desktop
	GetWindowRect(hDesktop, &desktop);
	// return height
	return desktop.bottom;
}
static int d_width = GetDesktopResolutionWidth();
static int d_height = GetDesktopResolutionHeight();
// Set Max Desktop Height and Width
#define SCREEN_WIDTH d_width
#define SCREEN_HEIGHT d_height
#endif

//=======================================================================
/**                           DEBUG TRACE                              */
/* Debug Trace Enabled */
#ifdef  MYAPP_DEBUG_TRACE
#include <stdio.h>
#define DbgPrintf printf
#else
/* Debug Trace Disabled */
#define DbgPrintf DbgEmpty
#endif

struct Timer {
	float curr, prev, now;
	bool done;
	bool coolDown(float t) {
		curr = clock();
		now = curr - prev;
		if(t <= now) {
			prev = curr;
			return true;
		}

	};
};

#define NUMFILES 5
#define BUFFER 20
#define WINDOWBUFF 100